
SET(FFMPEG_DIR ${PROJECT_SOURCE_DIR}/third_party/ffmpeg)

if (CMAKE_HOST_WIN32)
	
	if(CMAKE_SIZEOF_VOID_P EQUAL 8)
		SET(FFMPEG_DIR ${THIRD_PARTY}/ffmpeg/x64)
	endif()
	
	SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/bin)
	SET(FFMPEG_LIBRARIES avutil avcodec avformat swresample swscale avfilter)
else()
	SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/lib ${FFMPEG_DIR}/bin)
	SET(FFMPEG_LIBRARIES avutil-55 avcodec-57 avformat-57 swresample-2 swscale-4  avfilter-6)
	
	if ("aarch64" STREQUAL "${CMAKE_SYSTEM_PROCESSOR}")
		SET(FFMPEG_LIBRARY_DIR ${THIRD_PARTY}/ffmpeg/arm ${FFMPEG_DIR}/lib ${FFMPEG_DIR}/bin)
	endif()

	if (CMAKE_C_COMPILER MATCHES "hisiv300")
		SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/hisiv300)
	endif()
	
	if (CMAKE_C_COMPILER MATCHES "hisiv400")
		SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/hisiv400)
	endif()

	if (CMAKE_C_COMPILER MATCHES "hisiv500")
        	SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/hisiv500)
	endif()

	if (CMAKE_C_COMPILER MATCHES "hisiv600")
	        SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/hisiv600)
        endif()
	
	if (CMAKE_C_COMPILER MATCHES "himix100")
	        SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/himix100)
		SET(FFMPEG_LIBRARIES avutil-55 avcodec-57 avformat-57 swresample-2 swscale-4 postproc-54 avfilter-6)
	endif()

	if (CMAKE_C_COMPILER MATCHES "himix200")
                SET(FFMPEG_LIBRARY_DIR ${FFMPEG_DIR}/himix200)
		SET(FFMPEG_LIBRARIES avutil-55 avcodec-57 avformat-57 swresample-2 swscale-4 postproc-54 avfilter-6)
        endif()

endif()
